package com.gs.zsmanage.dao;

import com.gs.zsmanage.vo.MenuTwo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CustomMenuMapper {

    //SELECT  DISTINCT(menu_one) FROM (SELECT * FROM t_menu WHERE id in (SELECT menu_id FROM t_department_menu WHERE department = '交通运输局')) as p
    List<String> listCustomMenuOnesByDepartment(@Param("department") String department);

    //SELECT id, menu_two,url FROM (SELECT * FROM t_menu WHERE id in (SELECT menu_id FROM t_department_menu WHERE department = '交通运输局')) as p WHERE menu_one = '天气预报'
    List<MenuTwo> listCustomMenuTwoAndUrls(@Param("department") String department, @Param("menuOne") String menuOne);

    void addDepartmentMenu(@Param("department") String department, @Param("menuId") Integer menuId);

    void deleteDepartmentMenu(@Param("department") String department, @Param("menuId") Integer menuId);


    //SELECT DISTINCT(menu_one) FROM t_menu
    List<String> listAllMenuOnes();

    //SELECT id, menu_two,url FROM t_menu where menu_one = '天气预报'
    List<MenuTwo> listAllMenuTwoAndUrls(String menuOne);


}
